<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vue</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
  <div id="root"></div>
  <script>
    // 利用extend构造器 创建一个“子类”
    // 注： 在 Vue.extend() 中它必须是函数
    let Profile = Vue.extend({
      template: '<p v-my-directive>{{firstName}} {{lastName}} aka {{alias}} {{obj.aa}}</p>',
      data: function () {
        return {
          firstName: 'Walter',
          lastName: 'White',
          alias: 'Heisenberg',
          obj: {
            a: 1
          }
        }
      }
    })

    new Profile().$mount('#root');
</script>
</body>
</html>